import QtQuick 2.6

Item {
    id:root
    property url fileUrl

    function open()
    {
        loader.item.open()
    }
    function close()
    {
        loader.item.close()
    }

    signal accepted
    signal rejected
    signal error

    onAccepted:{
        root.fileUrl = loader.item.fileUrl
    }

    visible: false

    Component.onCompleted: {
        if(Qt.platform.os === "android")
        {
            loader.source = "AudioPicker_Android.qml"
            loader.item.error.connect(root.error)
        }
        else
        {
            loader.source = "AudioPicker_Normal.qml"
        }
        loader.item.accepted.connect(root.accepted)
        loader.item.rejected.connect(root.rejected)
    }

    Loader {
        id:loader
        anchors.fill: parent
    }
}
